package com.CmJava.crowd.entity;

import java.util.Arrays;

public class Email {
    private emailUnit[] emailUnit;

    public Email() {
    }

    public Email(int emailUnitCount) {
        Email.emailUnit[] emailUnits = new emailUnit[emailUnitCount];
        for (int i=0;i<emailUnitCount;i++) {
            emailUnits[i] = new emailUnit();
        }
        this.emailUnit = emailUnits;
    }

    public Email.emailUnit[] getEmailUnit() {
        return emailUnit;
    }

    public void setEmailUnit(Email.emailUnit[] emailUnit) {
        this.emailUnit = emailUnit;
    }

    @Override
    public String toString() {
        return "Email{" +
                "emailUnit=" + Arrays.toString(emailUnit) +
                '}';
    }

    public class emailUnit{
        private String subject;
        private String address;
        private String date;
        private String textMessage;
        private String htmlMessage;
        private byte[] fileMessage;
        // 0,未读；1已读
        private int unread;

        public emailUnit() {

        }

        public emailUnit(String subject, String address, String date, String textMessage, String htmlMessage, byte[] fileMessage, int unread) {
            this.subject = subject;
            this.address = address;
            this.date = date;
            this.textMessage = textMessage;
            this.htmlMessage = htmlMessage;
            this.fileMessage = fileMessage;
            this.unread = unread;
        }

        public String getSubject() {
            return subject;
        }

        public void setSubject(String subject) {
            this.subject = subject;
        }

        public String getAddress() {
            return address;
        }

        public void setAddress(String address) {
            this.address = address;
        }

        public String getDate() {
            return date;
        }

        public void setDate(String date) {
            this.date = date;
        }

        public String getTextMessage() {
            return textMessage;
        }

        public void setTextMessage(String textMessage) {
            this.textMessage = textMessage;
        }

        public String getHtmlMessage() {
            return htmlMessage;
        }

        public void setHtmlMessage(String htmlMessage) {
            this.htmlMessage = htmlMessage;
        }

        public byte[] getFileMessage() {
            return fileMessage;
        }

        public void setFileMessage(byte[] fileMessage) {
            this.fileMessage = fileMessage;
        }

        public int getUnread() {
            return unread;
        }

        public void setUnread(int unread) {
            this.unread = unread;
        }

        @Override
        public String toString() {
            return "emailUnit{" +
                    "subject='" + subject + '\'' +
                    ", address='" + address + '\'' +
                    ", date='" + date + '\'' +
                    ", textMessage='" + textMessage + '\'' +
                    ", htmlMessage='" + htmlMessage + '\'' +
                    ", fileMessage=" + Arrays.toString(fileMessage) +
                    ", unread=" + unread +
                    '}';
        }
    }
}
